<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="db.TmppurDAO"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="db.Tmppur"%>
<%@page import="db.User"%>
<%@page import="db.UserDAO"%>
<%@page import="db.PurmatDAO"%>
<%@ include file="/jsp/common/utility/volti.jsp" %>
<%@ include file="/jsp/common/utility/logined.jsp" %>
<%
	WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	TmppurDAO tmppurDao = (TmppurDAO)ctx.getBean("TmppurDAO");
	UserDAO userDao = (UserDAO)ctx.getBean("UserDAO");
	PurmatDAO purmatDao = (PurmatDAO)ctx.getBean("PurmatDAO");
	
	int uid = (Integer)session.getAttribute("id");
	String idPar = request.getParameter("id");
	int id = Integer.parseInt(idPar);
	
	Tmppur tmppur = tmppurDao.findById(id);
	request.setAttribute("tmppur",tmppur);
	
	List purmats = purmatDao.findByTmppurId(tmppur.getId());
	request.setAttribute("purmats",purmats);
	
	User reqUser = userDao.findById(tmppur.getPurreq().getReqUserId());
	request.setAttribute("reqUser",reqUser);
	
	User auditUser = userDao.findById(uid);
	request.setAttribute("auditUser",auditUser);
	
	pageContext.forward("/vm/procure/procureApp_5.vm");
%>